import {createRouter, createWebHistory} from 'vue-router'

export const constantRoutes = [
    {
        path: '/',
        component: () => import('../layout/BasicLayout'),
        redirect: '/index',
        children: [{
            path: '/login',
            name: 'UserLogin',
            meta: {tag: '登录'},
            component: () => import('../views/user/login')
        },
            {
                path: '/reg',
                name: 'UserReg',
                meta: {tag: '注册'},
                component: () => import('../views/user/reg')
            },
            {
                path: '/index',
                name: 'Index',
                meta: {tag: '搜索'},
                component: () => import('../views/index/index')
            },
            {
                path: '/search',
                name: 'FileSearch',
                meta: {tag: '检索'},
                component: () => import('../views/search')
            },
            {
                path: '/sys/file/list',
                name: 'SysFileList',
                meta: {tag: '文档页'},
                component: () => import('../views/sys/file/list')
            },
            {
                path: '/sys/file/reg',
                name: 'SysFileReg',
                meta: {tag: '文档维护'},
                component: () => import('../views/sys/file/reg')
            },
            {
                path: '/sys/dic',
                name: 'SysDic',
                meta: {tag: '参数配置'},
                component: () => import('../views/sys/dic')
            },
            {
                path: '/user/list',
                name: 'UserList',
                meta: {tag: '用户管理'},
                component: () => import('../views/user/list')
            },
            {
                path: '/qa',
                name: 'Qa',
                meta: {tag: 'QA'},
                component: () => import('../views/qa')
            },
            {
                path: '/report',
                name: 'Report',
                meta: {tag: '统计'},
                component: () => import('../views/report')
            },
        ]
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes: constantRoutes
})

export default router
